<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>混合开发</title>
</head>
<body>
    <div></div>
    <img src="./a.png" alt="">
    <button onclick="selectImg()">打开相册</button>
</body>
</html>
<script>
    //直接写js代码
    function changeImg(){
        //1.获取img这个元素
        const img = document.querySelector('img')
        //2.修改元素的属性
        img.src = './b.png'
    }
    async function selectImg(){
      //通知鸿蒙，让鸿蒙设备打开相册
       const res = await harmonyDevice.selectImage()
       const div = document.querySelector('div')
       div.innerText = JSON.stringify(res)
    }

</script>